
package com.rzico.market.plugin.jd;

import com.rzico.basics.entity.Enterprise;
import com.rzico.basics.entity.Supplier;
import com.rzico.basics.service.EnterpriseService;
import com.rzico.basics.service.SupplierService;
import com.rzico.core.entity.SysPlugin;
import com.rzico.core.entity.SysPluginAttribute;
import com.rzico.core.model.PluginAttribute;
import com.rzico.core.service.SysPluginAttributeService;
import com.rzico.market.entity.MarketProduct;
import com.rzico.market.plugin.MarketPlugin;
import com.rzico.util.CodeGenerator;
import com.rzico.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.*;

/**
 * Plugin -  京东实物对接API
 * 
 * @author RZICO.BOOT
 * @version 3.0
 */
@Component("marketJDPlugin")
public class MarketJDPlugin extends MarketPlugin {

	protected Logger logger = LoggerFactory.getLogger(this.getClass());

	@Autowired
	private EnterpriseService enterpriseService;

	@Autowired
	private SupplierService supplierService;

	@Autowired
	protected SysPluginAttributeService sysPluginAttributeService;

	@Override
	public String getName() {
		return "京东实物对接API";
	}

	@Override
	public String getVersion() {
		return "1.8.9";
	}

	@Override
	public List<PluginAttribute> getAttributeKeys() {
		List<PluginAttribute> data = new ArrayList<>();
		data.add(new PluginAttribute("token","token",PluginAttribute.STRING_VALUE));
		data.add(new PluginAttribute("thumbnailPath","thumbnailPath",PluginAttribute.STRING_VALUE));
		data.add(new PluginAttribute("imgPath","imgPath",PluginAttribute.STRING_VALUE));
		return data;
	}

	/**
	 * 自动安装京东商品插件,并设置token属性
	 * 1.判断是否已安装京东商品插件，未安装的话自动安装插件及添加token属性值
	 * 2.已安装完京东商品插件，若未存在token属性值则添加，已存在token属性值则更新
	 * @param sysplugin
	 * @param token
	 * @param muchId
	 * @return
	 */
	public SysPlugin setToken(SysPlugin sysplugin, String token, String muchId){
		if (null == sysplugin){
			sysplugin = new SysPlugin();
			String sysPluginId = CodeGenerator.getUUID();
			sysplugin.setId(sysPluginId);
			sysplugin.setName("京东实物商品");
			sysplugin.setVersion("1.8.9.0");
			sysplugin.setPluginId("marketJDPlugin");
			sysplugin.setPluginType(5);
			sysplugin.setIsInstalled(false);
			sysplugin.setIsEnabled(false);
			sysplugin.setMchId(muchId);
			sysplugin.setCreateDate(new Date());
			sysPluginService.insert(sysplugin);
			SysPluginAttribute sysPluginAttribute = new SysPluginAttribute();
			sysPluginAttribute.setId(CodeGenerator.getUUID());
			sysPluginAttribute.setPluginId(sysPluginId);
			sysPluginAttribute.setName("token");
			sysPluginAttribute.setAttribute(token);
			sysPluginAttribute.setType("1");
			sysPluginAttributeService.insert(sysPluginAttribute);
			List<SysPluginAttribute> attributeList = new ArrayList<SysPluginAttribute>();
			attributeList.add(sysPluginAttribute);
			sysplugin.setSysPluginAttribute(attributeList);
		} else {
			Map<String, Object> map = new HashMap<String, Object>();
			map.put("pluginId", sysplugin.getId());
			map.put("name", "token");
			List<SysPluginAttribute> sysPluginAttributeList = sysPluginAttributeService.selectList(map);
			/**
			 * 1.获取插件所有的属性
			 * 2.将所有的属性赋值给新的属性列表（除token外）
			 * 3.再将新的属性列表赋值给插件
			 */
			List<SysPluginAttribute> attributeList = sysplugin.getSysPluginAttribute();//获取插件的属性
			List<SysPluginAttribute> newAttributeList = new ArrayList<SysPluginAttribute>();//新的属性列表
			if (0 < attributeList.size()) {
				for (SysPluginAttribute attribute : attributeList) {
					if (!"token".equals(attribute.getName())) {
						newAttributeList.add(attribute);
					}
				}
			}
			SysPluginAttribute sysPluginAttribute = new SysPluginAttribute();
			if (0 < sysPluginAttributeList.size()) {
				//更新token属性
				sysPluginAttribute = sysPluginAttributeList.get(0);
				if (!token.equals(sysplugin.getAttribute("token"))) {
					sysPluginAttribute.setAttribute(token);
					sysPluginAttributeService.updateByPrimaryKey(sysPluginAttribute);
					newAttributeList.add(sysPluginAttribute);
					sysplugin.setSysPluginAttribute(newAttributeList);
				}
			} else {
				//添加token属性
				sysPluginAttribute.setId(CodeGenerator.getUUID());
				sysPluginAttribute.setPluginId(sysplugin.getId());
				sysPluginAttribute.setName("token");
				sysPluginAttribute.setAttribute(token);
				sysPluginAttribute.setType("1");
				sysPluginAttributeService.insert(sysPluginAttribute);
				newAttributeList.add(sysPluginAttribute);
				sysplugin.setSysPluginAttribute(newAttributeList);
			}
		}
		return sysplugin;
	}

	/**
	 * 安装京东商品插件
	 * 若未安装，则自动安装，并添加缩略图访问路径及大图图片访问路径
	 * @param sysplugin
	 * @return
	 */
	public SysPlugin setImagePath(SysPlugin sysplugin){
		List<SysPluginAttribute> addAttributeList = new ArrayList<SysPluginAttribute>();//新增属性列表
		List<SysPluginAttribute> newAttributeList = new ArrayList<SysPluginAttribute>();//新的属性列表，赋值给插件用
		String thumbnailPath = sysplugin.getAttribute("thumbnailPath");
		if (StringUtils.isEmpty(thumbnailPath)) {
			//添加缩略图路径
			SysPluginAttribute mainAttribute = new SysPluginAttribute();
			mainAttribute.setId(CodeGenerator.getUUID());
			mainAttribute.setPluginId(sysplugin.getId());
			mainAttribute.setName("thumbnailPath");
			mainAttribute.setAttribute("http://img13.360buyimg.com/n1/");
			mainAttribute.setType("1");
			addAttributeList.add(mainAttribute);
			newAttributeList.add(mainAttribute);
		}
		String imgPath = sysplugin.getAttribute("imgPath");
		if (StringUtils.isEmpty(imgPath)) {
			//添加大图图片路径
			SysPluginAttribute attachAttribute = new SysPluginAttribute();
			attachAttribute.setId(CodeGenerator.getUUID());
			attachAttribute.setPluginId(sysplugin.getId());
			attachAttribute.setName("imgPath");
			attachAttribute.setAttribute("http://img13.360buyimg.com/n12/");
			attachAttribute.setType("1");
			addAttributeList.add(attachAttribute);
			newAttributeList.add(attachAttribute);
		}
		if (0 < addAttributeList.size()) {
			/**
			 * 1.若有新增属性保存信息，并添加至新的属性列表
			 * 2.获取插件所有的属性将所有的属性赋值给新的属性列表并赋值给插件
			 * 3.若无新增属性则不修改
			 */
			sysPluginAttributeService.insertList(addAttributeList);
			List<SysPluginAttribute> attributeList = sysplugin.getSysPluginAttribute();
			if (0 < attributeList.size()){
				for (SysPluginAttribute attribute : attributeList) {
					newAttributeList.add(attribute);
				}
			}
			sysplugin.setSysPluginAttribute(newAttributeList);
		}
		return sysplugin;
	}

	/**
	 * 设置增专票收票信息
	 * @param sysplugin
	 * @return
	 */
	public SysPlugin setInvoiceInfo(SysPlugin sysplugin){
		List<SysPluginAttribute> addAttributeList = new ArrayList<SysPluginAttribute>();//新增属性列表
		List<SysPluginAttribute> newAttributeList = new ArrayList<SysPluginAttribute>();//新的属性列表，赋值给插件用
		String email = sysplugin.getAttribute("email");//邮箱
		if (StringUtils.isEmpty(email)) {
			//添加缩略图路径
			SysPluginAttribute mainAttribute = new SysPluginAttribute();
			mainAttribute.setId(CodeGenerator.getUUID());
			mainAttribute.setPluginId(sysplugin.getId());
			mainAttribute.setName("email");
			mainAttribute.setAttribute("admin@hulu.fj.cn");
			mainAttribute.setType("1");
			addAttributeList.add(mainAttribute);
			newAttributeList.add(mainAttribute);
		}
		String companyName = sysplugin.getAttribute("companyName");//发票抬头
		if (StringUtils.isEmpty(companyName)) {
			//添加大图图片路径
			SysPluginAttribute attachAttribute = new SysPluginAttribute();
			attachAttribute.setId(CodeGenerator.getUUID());
			attachAttribute.setPluginId(sysplugin.getId());
			attachAttribute.setName("companyName");
			attachAttribute.setAttribute("福建望岳科技有限公司");
			attachAttribute.setType("1");
			addAttributeList.add(attachAttribute);
			newAttributeList.add(attachAttribute);
		}
		String invoiceName = sysplugin.getAttribute("invoiceName");//收票人姓名
		if (StringUtils.isEmpty(invoiceName)) {
			//添加大图图片路径
			SysPluginAttribute attachAttribute = new SysPluginAttribute();
			attachAttribute.setId(CodeGenerator.getUUID());
			attachAttribute.setPluginId(sysplugin.getId());
			attachAttribute.setName("invoiceName");
			attachAttribute.setAttribute("汤凌伟");
			attachAttribute.setType("1");
			addAttributeList.add(attachAttribute);
			newAttributeList.add(attachAttribute);
		}
		String invoicePhone = sysplugin.getAttribute("invoicePhone");//收票人电话
		if (StringUtils.isEmpty(invoicePhone)) {
			//添加大图图片路径
			SysPluginAttribute attachAttribute = new SysPluginAttribute();
			attachAttribute.setId(CodeGenerator.getUUID());
			attachAttribute.setPluginId(sysplugin.getId());
			attachAttribute.setName("invoicePhone");
			attachAttribute.setAttribute("15296007090");
			attachAttribute.setType("1");
			addAttributeList.add(attachAttribute);
			newAttributeList.add(attachAttribute);
		}
		String invoiceProvice = sysplugin.getAttribute("invoiceProvice");//增专票收票人所在省
		if (StringUtils.isEmpty(invoiceProvice)) {
			//添加大图图片路径
			SysPluginAttribute attachAttribute = new SysPluginAttribute();
			attachAttribute.setId(CodeGenerator.getUUID());
			attachAttribute.setPluginId(sysplugin.getId());
			attachAttribute.setName("invoiceProvice");
			attachAttribute.setAttribute("16");
			attachAttribute.setType("1");
			addAttributeList.add(attachAttribute);
			newAttributeList.add(attachAttribute);
		}
		String invoiceCity = sysplugin.getAttribute("invoiceCity");//增专票收票人所在市
		if (StringUtils.isEmpty(invoiceCity)) {
			//添加大图图片路径
			SysPluginAttribute attachAttribute = new SysPluginAttribute();
			attachAttribute.setId(CodeGenerator.getUUID());
			attachAttribute.setPluginId(sysplugin.getId());
			attachAttribute.setName("invoiceCity");
			attachAttribute.setAttribute("1329");
			attachAttribute.setType("1");
			addAttributeList.add(attachAttribute);
			newAttributeList.add(attachAttribute);
		}
		String invoiceCounty = sysplugin.getAttribute("invoiceCounty");//增专票收票人所在区/县
		if (StringUtils.isEmpty(invoiceCounty)) {
			//添加大图图片路径
			SysPluginAttribute attachAttribute = new SysPluginAttribute();
			attachAttribute.setId(CodeGenerator.getUUID());
			attachAttribute.setPluginId(sysplugin.getId());
			attachAttribute.setName("invoiceCounty");
			attachAttribute.setAttribute("46147");
			attachAttribute.setType("1");
			addAttributeList.add(attachAttribute);
			newAttributeList.add(attachAttribute);
		}
		String invoiceTown = sysplugin.getAttribute("invoiceTown");//增专票收票人街道/四级地址
		if (StringUtils.isEmpty(invoiceTown)) {
			//添加大图图片路径
			SysPluginAttribute attachAttribute = new SysPluginAttribute();
			attachAttribute.setId(CodeGenerator.getUUID());
			attachAttribute.setPluginId(sysplugin.getId());
			attachAttribute.setName("invoiceTown");
			attachAttribute.setAttribute("51489");
			attachAttribute.setType("1");
			addAttributeList.add(attachAttribute);
			newAttributeList.add(attachAttribute);
		}
		String invoiceAddress = sysplugin.getAttribute("invoiceAddress");//增专票收票人所在地址
		if (StringUtils.isEmpty(invoiceAddress)) {
			//添加大图图片路径
			SysPluginAttribute attachAttribute = new SysPluginAttribute();
			attachAttribute.setId(CodeGenerator.getUUID());
			attachAttribute.setPluginId(sysplugin.getId());
			attachAttribute.setName("invoiceAddress");
			attachAttribute.setAttribute("福建省莆田市荔城区荔园中路189号艾力艾国际中心2号楼21层");
			attachAttribute.setType("1");
			addAttributeList.add(attachAttribute);
			newAttributeList.add(attachAttribute);
		}
		String regCode = sysplugin.getAttribute("regCode");//专票资质纳税人识别号
		if (StringUtils.isEmpty(regCode)) {
			//添加大图图片路径
			SysPluginAttribute attachAttribute = new SysPluginAttribute();
			attachAttribute.setId(CodeGenerator.getUUID());
			attachAttribute.setPluginId(sysplugin.getId());
			attachAttribute.setName("regCode");
			attachAttribute.setAttribute("91350304MA335XM10K");
			attachAttribute.setType("1");
			addAttributeList.add(attachAttribute);
			newAttributeList.add(attachAttribute);
		}
		if (0 < addAttributeList.size()) {
			/**
			 * 1.若有新增属性保存信息，并添加至新的属性列表
			 * 2.获取插件所有的属性将所有的属性赋值给新的属性列表并赋值给插件
			 * 3.若无新增属性则不修改
			 */
			sysPluginAttributeService.insertList(addAttributeList);
			List<SysPluginAttribute> attributeList = sysplugin.getSysPluginAttribute();
			if (0 < attributeList.size()){
				for (SysPluginAttribute attribute : attributeList) {
					newAttributeList.add(attribute);
				}
			}
			sysplugin.setSysPluginAttribute(newAttributeList);
		}
		return sysplugin;
	}

	/**
	 * 获取京东商品价格信息，定时更新用
	 * @param sysPlugin
	 * @param marketProductList
	 * @return
	 */
	public List<MarketProduct> getProductPrice(SysPlugin sysPlugin, List<MarketProduct> marketProductList) {
		// 根据京东商品sku获取价格并保存
		for (MarketProduct m : marketProductList) {
			JDProductInfo jdp = JDServiceUtils.selectJDProductPrice(sysPlugin.getAttribute("token"), m.getSkuId());
			if (null != jdp) {
				//市场价
				m.setMarketPrice(new BigDecimal(jdp.getJdPrice()));
				//销售价
				m.setPrice(new BigDecimal(jdp.getPrice()));
				//税率
				String tax = jdp.getTax();
				if (!"0".equals(tax)) {
					m.setTax(new BigDecimal(tax).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP));
				} else {
					m.setTax(new BigDecimal(0));
				}
				//结算价
				m.setCost(new BigDecimal(jdp.getPrice()));
			}
		}
		return marketProductList;
	}

	/**
	 * 获取京东商品上下架状态，定时更新用
	 * @param sysPlugin
	 * @param marketProductList
	 * @return
	 */
	public List<MarketProduct> getProductState(SysPlugin sysPlugin, List<MarketProduct> marketProductList) {
		//根据京东商品sku获取商品上下架状态
		for (MarketProduct m : marketProductList) {
			JDProductInfo jdp = JDServiceUtils.selectJDProductState(sysPlugin.getAttribute("token"), m.getSkuId());
			if (null != jdp) {
				if ("1".equals(jdp.getState())) {
					m.setIsMarketable(true);
				} else {
					m.setIsMarketable(false);
				}
			}
		}
		return marketProductList;
	}

	/**
	 * 获取京东商品可售性信息，定时更新用
	 * @param sysPlugin
	 * @param marketProductList
	 * @return
	 */
	public List<MarketProduct> getProductSaleState(SysPlugin sysPlugin, List<MarketProduct> marketProductList) {
		//根据京东商品sku获取商品可售性
		for (MarketProduct m : marketProductList) {
			JDProductInfo jdp = JDServiceUtils.selectJDProductSaleState(sysPlugin.getAttribute("token"), m.getSkuId());
			if (null != jdp) {
				if ("1".equals(jdp.getSaleState())) {
					m.setSaleState(true);
				} else {
					m.setSaleState(false);
				}
			}
		}
		return marketProductList;
	}

	/**
	 * 获取京东商品图片信息，定时更新用
	 * @param sysPlugin
	 * @param marketProductList
	 * @return
	 */
	public List<MarketProduct> getProductImage(SysPlugin sysPlugin, List<MarketProduct> marketProductList) {
		//根据京东商品sku获取商品可售性
		for (MarketProduct m : marketProductList) {
			//查询图片信息并保存
			String imageInfo = JDServiceUtils.selectJDProductImage(sysPlugin.getAttribute("token"), m.getSkuId());
			if (StringUtils.isNotEmpty(imageInfo)) {
				m.setImage(imageInfo);
				//其他资源
				m.setMeta(JDServiceUtils.getImageMeta(imageInfo, sysPlugin.getAttribute("imgPath")));
			}
		}
		return marketProductList;
	}

	/**
	 * 获取京东商品商品信息，定时更新商品信息
	 * @param sysPlugin
	 * @param marketProductList
	 * @return
	 */
	public List<MarketProduct> getProductInfo(SysPlugin sysPlugin, List<MarketProduct> marketProductList) {
		//根据京东商品sku获取商品可售性
		for (MarketProduct marketProduct : marketProductList) {
			JDProductInfo jdp = JDServiceUtils.selectJDProductInfo(sysPlugin.getAttribute("token"), marketProduct.getSkuId());
			if (null != jdp) {
				//创建时间
				marketProduct.setModifyDate(new Date());
				//商品名称
				marketProduct.setName(jdp.getName());
				//描述说明
				marketProduct.setSubTitle(jdp.getShouhou());
				//售卖单位
				if (StringUtils.isNotEmpty(jdp.getSaleUnit()) && 0 != jdp.getSaleUnit().trim().length()) {
					marketProduct.setUnit(jdp.getSaleUnit());
				} else {
					marketProduct.setUnit("件");
				}
				//重量
				if (StringUtils.isNotEmpty(jdp.getWeight())) {
					marketProduct.setWeight(new BigDecimal(jdp.getWeight()));
				} else {
					marketProduct.setWeight(BigDecimal.ZERO);
				}
				//缩略图
				marketProduct.setThumbnail(sysPlugin.getAttribute("thumbnailPath") + jdp.getImagePath());
				//商品详情
				if ("[]".equals(jdp.getWxintroduction())) {
					marketProduct.setContent(" ");
				} else {
					marketProduct.setContent(JDServiceUtils.getImageContent(jdp.getWxintroduction()));
				}
				//商品详情图
				marketProduct.setWxintroduction(jdp.getWxintroduction());
				//品牌名称
				marketProduct.setBrandName(jdp.getBrandName());
			/*//查询图片信息并保存
			String imageInfo = JDServiceUtils.selectJDProductImage(sysPlugin.getAttribute("token"), jdp.getSku());
			marketProduct.setImage(imageInfo);
			//其他资源
			marketProduct.setMeta(JDServiceUtils.getImageMeta(imageInfo, sysPlugin.getAttribute("imgPath")));*/
			}
		}
		return marketProductList;
	}

	/**
	 * 获取商品资料
	 * @return {"return_code", "0001","error_msg","获取商品资料出错"},{"return_code", "0000",其了支付要的参数};
	 */
	@Override
	public List<MarketProduct> getProducts(SysPlugin sysPlugin, List<String> skuList) {
		//调用京东获取商品信息接口
		List<JDProductInfo>  productList = JDServiceUtils.selectJDProduct(sysPlugin.getAttribute("token"), skuList);
		//保存的商品信息
		List<MarketProduct> marketProductList = new ArrayList<MarketProduct>();
		//京东商品根据分类id与品牌名称进行good分类
//		List<Map<String, Object>> cateList = new ArrayList<Map<String, Object>>();
//		for (JDProductInfo jdp : productList) {
//			Map<String, Object> map = new HashMap<String, Object>();
//			map.put("brandName", jdp.getBrandName());
//			if (!cateList.contains(map)) {
//				cateList.add(map);
//			}
//		}
		//给maplist中的map进行赋值，给相同分类设置goods的值
//		int i = 0;
//		for (Map<String, Object> map : cateList) {
//			i ++;
//			map.put("value", "jd-" + i);
//		}
		Long enterpriseId = 0L;
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("name","葫芦派");
		List<Enterprise> enterpriseList= enterpriseService.selectList(param);
		if (0 < enterpriseList.size()) {
			enterpriseId = enterpriseList.get(0).getId();
		}
		Long supplierId = 0L;
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("name","京东");
		List<Supplier> supplierList = supplierService.selectList(params);
		if (0 < supplierList.size()) {
			supplierId = supplierList.get(0).getId();
		}
		//设置京东商品信息
		for (JDProductInfo jdp : productList) {
			MarketProduct marketProduct = new MarketProduct();
			//创建时间
			marketProduct.setCreateDate(new Date());
			//是否列出
			marketProduct.setIsList(true);
			//是否上架
			if ("1".equals(jdp.getState())) {
				marketProduct.setIsMarketable(true);
			} else {
				marketProduct.setIsMarketable(false);
			}
			//市场价
			marketProduct.setMarketPrice(BigDecimal.ZERO);
			//商品名称
			marketProduct.setName(jdp.getName());
			//描述说明
			marketProduct.setSubTitle(jdp.getShouhou());
			//销售价
			marketProduct.setPrice(BigDecimal.ZERO);
			//结算价
			marketProduct.setCost(BigDecimal.ZERO);
			//税率
			marketProduct.setTax(BigDecimal.ZERO);
			//sn
			marketProduct.setSn("jd-" + jdp.getSku());
			//售卖单位
			if (StringUtils.isNotEmpty(jdp.getSaleUnit())) {
				marketProduct.setUnit(jdp.getSaleUnit());
			} else {
				marketProduct.setUnit("件");
			}
			//单位系数,用默认
			marketProduct.setUnitRate(BigDecimal.ONE);
			//重量
			if (StringUtils.isNotEmpty(jdp.getWeight())) {
				marketProduct.setWeight(new BigDecimal(jdp.getWeight()));
			} else {
				marketProduct.setWeight(BigDecimal.ZERO);
			}
			//缩略图
			marketProduct.setThumbnail(sysPlugin.getAttribute("thumbnailPath") + jdp.getImagePath());
			//类型
			marketProduct.setType(0);
			//保质期
			marketProduct.setQuality(0);
			//商品详情
			if ("[]".equals(jdp.getWxintroduction())) {
				marketProduct.setContent(" ");
			} else {
				marketProduct.setContent(JDServiceUtils.getImageContent(jdp.getWxintroduction()));
			}
			//商品详情图
			marketProduct.setWxintroduction(jdp.getWxintroduction());
			//品牌名称
			marketProduct.setBrandName(jdp.getBrandName());
			//供应商
			marketProduct.setSupplierId(supplierId);
			//skuid
			marketProduct.setSkuId(jdp.getSku());
			//市场插件id
			marketProduct.setMarketPluginId(sysPlugin.getPluginId());
			//来源商户
			marketProduct.setEnterpriseId(enterpriseId);
//			for (Map<String, Object> map : cateList) {
//				if (jdp.getBrandName().equals(map.get("brandName").toString())) {
//					marketProduct.setGoodId(map.get("value").toString());
//				}
//			}
			/*//查询图片信息并保存
			String imageInfo = JDServiceUtils.selectJDProductImage(sysPlugin.getAttribute("token"), jdp.getSku());
			marketProduct.setImage(imageInfo);
			//其他资源
			marketProduct.setMeta(JDServiceUtils.getImageMeta(imageInfo, sysPlugin.getAttribute("imgPath")));*/
			marketProductList.add(marketProduct);
		}

		return marketProductList;
	}

	/**
	 * 发货接口
	 * @return {"return_code", "0001","error_msg","获取商品资料出错"},{"return_code", "0000",其了支付要的参数};
	 */
//	@Override
//	public void shipping(SysPlugin sysPlugin, Shipping shipping) {
//
//	}

	@Override
	public int compareTo(MarketPlugin o) {
		return 0;
	}
}